Showing posts with label Tips and Tricks. Show all posts
Showing posts with label Tips and Tricks. Show all posts

Friday, July 27, 2012

Start FireFox with Multiple Tabs

Whenever I open Firefox, I open 3 sites:

  1. Our ISP's Control Center to monitor our VSAT status
  2. Foxite
  3. My Blog's dashboard

So what I do before is:

  1. Open up Firefox and select from my Bookmarks the one for our ISP Control Center
  2. Then click a new tab and select Foxite again from my Bookmarks
  3. Finally click again a new tab and select my blog's dashboard link. 

The process is just okay but since I decided that I really needed to check those 3 whenever I open Firefox, I finally decided to make opening those 3 sites automatic for me.

So if you have a similar need like mine and want to do the same, then the easiest thing to do is instruct your browser to open those sites, each on its own tab, on Firefox's initial run.  How to do that?

Tuesday, July 24, 2012

Scroll Form Programmaticaly

A VFP form is tuned up properly to the wheel of the mouse so when you scroll up and down, the form when scrollbars are shown will follow.  However, there are some reports that sometimes the form stops scrolling when mouse is on top of other objects like a container for instance.  Test this:


loTest = Createobject("Sample")
loTest.Show(1)

Define Class Sample As Form
      ScrollBars = 2
      ScrollPos = 0
      Caption = 'Container prevents scrolling'

      Add Object Container1 As Container With ;
            top = 25,;
            left = 25,;
            height = 400,;
            width = 500
Enddefine


You can scroll all you want using the mouse scroll to no avail when it is on top of that container, and you may wonder  why.  That is because an object like a container has its own "MouseWheel" event that is capturing that mouse wheel scrolling when your mouse pointer is on top of it.

So since it is capturing said movement of the mouse wheel, the trick then is to force scroll the form from within that object's own MouseWheel event.  What if you have more containers then?  Plus some more objects?  Then that is where BindEvent() comes very handy.

However, one problem pose with the above.  Unlike grid, a form do not have a DoScroll event where we can simply instruct it to scroll.  So how can we then scroll it programmatically?


Thursday, July 5, 2012

Grid Trick# 5 - Column Moved or Header Simply Clicked?

A question inside foxite is raised just now and it took my fancy on trying to find out how to differentiate if user simply clicks on the header of a column or has moved it.  Until I realize I was looking at the wrong things because really it comes only with two simple rules:

  1. If you wanted to do something when you click the header, then use header's click event
  2. If you wanted to do something when you reposition column, then use column's moved event
Here is a simple sample for that:

Zoom Outlook email message trick

I have learned a lot of things by reading and listening to others.  And there are some I learn by accident just like this one now.  Do you know we can zoom the outlook messages very easily?

I was just talking to my IT Support guy and at the same time trying to read an email, so I scrolled down using my mouse middle button but I suddenly realized I am zooming in and out instead of scrolling up or down.

The trick I later realized is because I am accidentally pressing Ctrl key while doing the scrolling using mouse middle button, because I wanted to do something before my mind was interrupted by my IT Support guy.  And as I was talking to him, I am playing with the mouse middle button as well, LOL!  Now I can read things clearer if I wanted to.

If you want to view it back to its accurate normal appearance, then just simply click on another message and click back onto that email message.

Enjoy!


Belatedly I realized that that feature also works as well with any Office products plus web browsers.

Tuesday, June 19, 2012

Facts about a country!



Well, I have constant visitors of my blog site but I believe most of you do not know one hidden feature here? Which is you can know some facts about your country or other countries as well. How is that then?


Monday, June 18, 2012

Grid Tricks#4- Clearer Search Results


Where is numbers 1, 2 & 3 Tricks?  We can simply treat #1 as the More Objects inside a Cell blog, #2 as the Various Images II blog and #3 as the Transparent Grid blog.

I decided to start showing some more tricks I do on my side using grids which I deem will be useful for others as well.  This is about making the search result clearer or more visible by highlighting the cell contents where a near match can be found.  If not, it is very tiring for the user's eyes to trace where exactly those near matches are.

Monday, May 21, 2012

A small Listbox appearance trick!

Another question has been raised by a foxite member inside the forum about a listbox not looking totally disabled when Enabled=.F. is set.  While the items in the listbox becomes disabled, the background color remains to be white.  And really it do not look cool that the rest of the other objects in a form like a textbox, when disabled changes color, while a listbox still remains white.

I have not seen this because I almost don't use Listboxes in favor of Grids. However, for those of you who may be wondering how this attitude can be circumnavigated, the trick lies between two properties:

a.  DisabledBackColor
b.  ItemBackColor

Thursday, March 29, 2012

Various Images in a Grid - Part II

I have previously posted a way to show different images in a grid on Weblogs using 5 image objects and employing DynamicCurrentControl property of the grid.  That is because the need is limited only to that 5 images. http://weblogs.foxite.com/sandstorm36/2008/08/09/placing-various-images-on-a-grid/

However, now that I need to really show varying undetermined number of images on a grid based on outside image files (jpegs) in a folder, that approach is a no no.  Therefore I sought other ways shown by experts such as Cetin Basoz and checked how that can be implemented on my needs. 

Most of the codes are adapted from Cetin's especially the usage of DynamicFontBold, except that this approach gets the images straight on outside files in a folder.  The trick is to be able to link the record with the real file name of the image file via one field (or several combined fields).  And since mine has an asset number and the images are named after the asset number (by design), then it did not pose any problem.  Here is the result:

Thursday, April 15, 2010

Tips & Tricks # 3: Using SSCAL on a from and to period

Tips & Tricks # 3: Using SSCAL on a from and to period

Although you can see that other SS classes complements each other, right now I am focusing my Tips & Tricks on SSCAL, on how to maximize its possible usage. So now, this simple image shows you that it is likewise good to use it on a From and To period (SSDTPicker is also good for this).

After finishing my enhancements on Editing Module last night, I started enhancing the GUI of Consumption Monitoring Module as well where I replaced my SSDTPickers with SSCALs. Here is the former look using a hot-skinning approach (all SS objects use the same theme and color):

- click to see its real size -


And here now is when I decided to design using combinations of various themes and colors plus adding some SSConfiner objects:

- click to see its real size -


As you can see, the impact on appearance and it seems on its capability versus the old one is huge although both images performs just the same thing.

One problem I begin to have though is when I started designing using a combination of my classes, I can't seem to be satisfied with an output as every color and theme combination I use produces a beautiful appearance. Still, the above is what I have finally decided.

To give you further example about my indecision on what would be the final output, I cannot seem to decide whether to show the front cover first or the inner one. Here it is again if the inside is what is shown as default apperance:

- click to see its real size -


Both have huge impact on a slightly different scale and both looks beautiful. Well, I bet I can decide on any of these two.

One thing I can brag though, using my SS Classes will definitely produce a web-like appearances on your ordinary forms. And that is only the start. Although the possible appearances when using combinations of my existing themes seems to be endless, Wait till I find the time and decide to create more themes and effects; which definitely I will do. Cheers!

Tips & Tricks # 2: Binding 2 or more SSCALs

Yesterday I have shown that an SS Class like SSCAL is not just a mere display to enhance the GUI of your app. It can be used as well to perform other things such as harvesting transactions for the day by using its value via SQL SELECT. Today I will show how to bind, sort of, an SSCAL class to another SSCAL class; on the same form.

Last night, I decided to enhance my Editing Module as users here in PNG are very careless of things. Regardless of several instructions and tools, they stil are very lax in encoding. So I have added another feature, i.e., auto-detecting of several vouchers used on a single asset for a day.

Originally I played with hot-skinning approach. This time however, I wanted to see how SS Classes will work when different colors and themes are combined in a single form; on a real project. And since the new design I have in mind will have a huge empty space on the left, I decided to use two SSCALs; one showing the front cover and the other the inner side. These SSCALs should be binded, sort of, with each other meaning when user clicks on the inner calendar date then the one on the left showing the front will likewise change.
- click on the image to see its real size -
Is it hard? Definitely not! It is actually simple.

Also yesterday I have shown the use of DODEFAULT(), now I will be showing how NODEFAULT favors us. I won't bother showing the codes anymore on how I was able to work on the enhanced editing module. What we will focus is on NODEFAULT and how linking is done on the front cover of the 2nd instance of SSCAL.

Since now we wanted to make it appear that those two SSCAL are binded with each other, we would not want to activate the default action of double-clicking the inner calendar which is showing its front cover (default). So what do we do? Instruct SSCAL "not" to perform that "Default" actions inside the class, i.e., NODEFAULT. On OpgDay DblClick Event, simply issue:

NODEFAULT

And that is it. SSCAL's front cover won't appear anymore. How to link then to the cover of the other SSCAL? Remember these codes from Tips & Trick 1 OpgDay Click Event?

DODEFAULT()
thisform._gridrefresh()

thisform.grid1.AfterRowColChange()


In addition to that, all I need is to add this to the next line:

thisform.sscal2._settings("orange",this.Parent.Parent._value)

So what does that do? I am "injecting" a new value to SSCAL instance # 2, the value coming from SSCAL instance # 1. And that is it!

Now, how about disabling SSCAL's 2nd instance of showing the inner calendar when clicked? Well we can again do the NODEFAULT trick BUT... by trying to prevent unnecessary additional objects inside my classes, I intentionally did not create a shape over the front cover for receiving double-click event. Showing the inner calendar via double-click is distributed to these objects:

a. The front cover image
b. The Calendar Day label
c. The Calendar Day's Shadow label
d. The Clock label
e. The Month label

So, insted of putting NODEFAULT on ALL of abovementioned double-click events, it is simpler to do this trick. Place a transparent-bordeless shape above the calendar and that is it! No amount of double-clicking will work now. Cool?

Enjoy using SSCAL!

Wednesday, April 14, 2010

Tips & Trick on SS Classes

Tips & Tricks # 1: Using SSCAL on acquiring transactions for the day

- click on the image to see it in its real size -

When I first decided to create the Editing module, I decided to utilize my SSCAL in acquiring the transactions for that day. So user will simply click on the day shown on SSCAL or navigate to the appropriate one. To do that, I have to tap into the Opgday Object of my SSCAL, Click event and place these:

DODEFAULT()
thisform._gridrefresh()
thisform.grid1.AfterRowColChange()


We will break the above one by one.

As you can see, DODEFAULT() is necessary to instruct SSCAL to perform whatever it is assigned to do then do some more which is calling a method for grid refreshing and calling also the grid's AfterRowColChange event which is basically needed to update display of other objects.

What I am doing now is moving away from SAFE SELECT approach, not that it is not working properly but I am trying to avoid too much record movements between cursors. All we need to do, to avoid Grid Reconstruction is simply something like this:

Thisform._GridRefresh Method:

* Reset RecordSource first
Thisform.grid1.RecordSource =''


* Perform the necessary SQL Select command

Select vchrno, liter, mreading, Alltrim(assets.assetno)+'-'+Alltrim(assets.xdescript) As xasset, fuelpk From fuelvchr ;

LEFT Outer Join assets On fuelvchr.assetfk = assets.assetpk;

WHERE xdate == Thisform.sscal1._value Into Cursor junkgrid Readwrite


* Bind the grid to the cursor and refresh

Thisform.grid1.RecordSourceType= 1

Thisform.grid1.RecordSource = "junkgrid"

Thisform.grid1.Refresh


That is fast, compact and easier. Same result. What is more, it won't reconstruct a grid.



Thisform.Grid1.AfterRowColChange() Event:

I use this event instead of creating a separate method as we can also call this from anywhere inside the form. The result is basically the same. I am using this to update other objects such as textboxes, comboboxes, etc. Basically what it does is simply something like these:

Thisform.txtXdate.Value = fuelvchr.xdate
Thisform.txtVchrno.Value = fuelvchr.vchrno
Thisform.txtliter.Value = fuelvchr.liter
Thisform.txtMreading.Value = fuelvchr.mreading
Thisform.edtRemarks.Value = fuelvchr.remarks



... and some more...

And so what it does, basically, as I have said is showing the transactions keyed in for the day using SSCAL. Check again the image above so you can visualize how it is done.

That trick can be used both on the per subscription and free version. Hope this will be useful to you. Next Trick is utilizing two SSCALs at the same time. Enjoy!